3.456 \(\int \cot ^3(e+f x) (a+b \sec ^3(e+f x)) \, dx\)

Optimal. Leaf size=72 \[ -\frac{(2 a-b) \log (1-\cos (e+f x))}{4 f}-\frac{(2 a+b) \log (\cos (e+f x)+1)}{4 f}-\frac{\csc ^2(e+f x) (a+b \cos (e+f x))}{2 f} \]

[Out]

-((a + b*Cos[e + f*x])*Csc[e + f*x]^2)/(2*f) - ((2*a - b)*Log[1 - Cos[e + f*x]])/(4*f) - ((2*a + b)*Log[1 + Co
s[e + f*x]])/(4*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0626343, antiderivative size = 72, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {4138, 1814, 633, 31} \[ -\frac{(2 a-b) \log (1-\cos (e+f x))}{4 f}-\frac{(2 a+b) \log (\cos (e+f x)+1)}{4 f}-\frac{\csc ^2(e+f x) (a+b \cos (e+f x))}{2 f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^3*(a + b*Sec[e + f*x]^3),x]

[Out]

-((a + b*Cos[e + f*x])*Csc[e + f*x]^2)/(2*f) - ((2*a - b)*Log[1 - Cos[e + f*x]])/(4*f) - ((2*a + b)*Log[1 + Co
s[e + f*x]])/(4*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 1814

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[((a
*g - b*f*x)*(a + b*x^2)^(p + 1))/(2*a*b*(p + 1)), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rule 633

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[-(a*c), 2]}, Dist[e/2 + (c*d)/(2*q),
Int[1/(-q + c*x), x], x] + Dist[e/2 - (c*d)/(2*q), Int[1/(q + c*x), x], x]] /; FreeQ[{a, c, d, e}, x] && NiceS
qrtQ[-(a*c)]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \cot ^3(e+f x) \left (a+b \sec ^3(e+f x)\right ) \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{b+a x^3}{\left (1-x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{(a+b \cos (e+f x)) \csc ^2(e+f x)}{2 f}+\frac{\operatorname{Subst}\left (\int \frac{-b+2 a x}{1-x^2} \, dx,x,\cos (e+f x)\right )}{2 f}\\ &=-\frac{(a+b \cos (e+f x)) \csc ^2(e+f x)}{2 f}+\frac{(2 a-b) \operatorname{Subst}\left (\int \frac{1}{1-x} \, dx,x,\cos (e+f x)\right )}{4 f}+\frac{(2 a+b) \operatorname{Subst}\left (\int \frac{1}{-1-x} \, dx,x,\cos (e+f x)\right )}{4 f}\\ &=-\frac{(a+b \cos (e+f x)) \csc ^2(e+f x)}{2 f}-\frac{(2 a-b) \log (1-\cos (e+f x))}{4 f}-\frac{(2 a+b) \log (1+\cos (e+f x))}{4 f}\\ \end{align*}

Mathematica [A]  time = 1.09186, size = 114, normalized size = 1.58 \[ -\frac{a \left (\cot ^2(e+f x)+2 \log (\tan (e+f x))+2 \log (\cos (e+f x))\right )}{2 f}-\frac{b \csc ^2\left (\frac{1}{2} (e+f x)\right )}{8 f}+\frac{b \sec ^2\left (\frac{1}{2} (e+f x)\right )}{8 f}+\frac{b \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )}{2 f}-\frac{b \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^3*(a + b*Sec[e + f*x]^3),x]

[Out]

-(b*Csc[(e + f*x)/2]^2)/(8*f) - (b*Log[Cos[(e + f*x)/2]])/(2*f) + (b*Log[Sin[(e + f*x)/2]])/(2*f) - (a*(Cot[e
+ f*x]^2 + 2*Log[Cos[e + f*x]] + 2*Log[Tan[e + f*x]]))/(2*f) + (b*Sec[(e + f*x)/2]^2)/(8*f)

________________________________________________________________________________________

Maple [A]  time = 0.054, size = 69, normalized size = 1. \begin{align*} -{\frac{ \left ( \cot \left ( fx+e \right ) \right ) ^{2}a}{2\,f}}-{\frac{a\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{b\csc \left ( fx+e \right ) \cot \left ( fx+e \right ) }{2\,f}}+{\frac{b\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{2\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^3*(a+b*sec(f*x+e)^3),x)

[Out]

-1/2/f*a*cot(f*x+e)^2-a*ln(sin(f*x+e))/f-1/2/f*b*csc(f*x+e)*cot(f*x+e)+1/2/f*b*ln(csc(f*x+e)-cot(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.00388, size = 84, normalized size = 1.17 \begin{align*} -\frac{{\left (2 \, a + b\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) +{\left (2 \, a - b\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac{2 \,{\left (b \cos \left (f x + e\right ) + a\right )}}{\cos \left (f x + e\right )^{2} - 1}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3*(a+b*sec(f*x+e)^3),x, algorithm="maxima")

[Out]

-1/4*((2*a + b)*log(cos(f*x + e) + 1) + (2*a - b)*log(cos(f*x + e) - 1) - 2*(b*cos(f*x + e) + a)/(cos(f*x + e)
^2 - 1))/f

________________________________________________________________________________________

Fricas [A]  time = 0.518424, size = 254, normalized size = 3.53 \begin{align*} \frac{2 \, b \cos \left (f x + e\right ) -{\left ({\left (2 \, a + b\right )} \cos \left (f x + e\right )^{2} - 2 \, a - b\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) -{\left ({\left (2 \, a - b\right )} \cos \left (f x + e\right )^{2} - 2 \, a + b\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + 2 \, a}{4 \,{\left (f \cos \left (f x + e\right )^{2} - f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3*(a+b*sec(f*x+e)^3),x, algorithm="fricas")

[Out]

1/4*(2*b*cos(f*x + e) - ((2*a + b)*cos(f*x + e)^2 - 2*a - b)*log(1/2*cos(f*x + e) + 1/2) - ((2*a - b)*cos(f*x
+ e)^2 - 2*a + b)*log(-1/2*cos(f*x + e) + 1/2) + 2*a)/(f*cos(f*x + e)^2 - f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**3*(a+b*sec(f*x+e)**3),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.41699, size = 244, normalized size = 3.39 \begin{align*} \frac{8 \, a \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right ) - 2 \,{\left (2 \, a - b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{{\left (a + b + \frac{4 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )}{\left (\cos \left (f x + e\right ) + 1\right )}}{\cos \left (f x + e\right ) - 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}}{8 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3*(a+b*sec(f*x+e)^3),x, algorithm="giac")

[Out]

1/8*(8*a*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1) - 2*(2*a - b)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) +
 1)) + (a + b + 4*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1))*(cos(f*
x + e) + 1)/(cos(f*x + e) - 1) + a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - b*(cos(f*x + e) - 1)/(cos(f*x + e)
+ 1))/f